package edu.hitsz.prop;

import edu.hitsz.aircraft.MobEnemy;
import edu.hitsz.basic.AbstractFlyingObject;

import java.awt.*;
import java.util.ArrayList;


public class BombEffect {
    private ArrayList<MobEnemy>  enemyList = new ArrayList<>();

    public void addEnemy(MobEnemy enemy)
    {
        enemyList.add(enemy);
    }

    public void removeEnemy(MobEnemy enemy)
    {
        enemyList.remove(enemy);
    }

    public void remove_vanish()
    {
        enemyList.removeIf(AbstractFlyingObject::notValid);
    }
    public void notifyAll(int decreased_hp)
    {
        for(MobEnemy mobEnemy: enemyList)
        {
            mobEnemy.update(decreased_hp);
        }
    }

    public void bombEffect(int decreased_hp)
    {
        notifyAll(decreased_hp);
    }

}
